#!/usr/bin/env python
# encoding: utf-8
# @author: 李勇
# @contact: 13732546017@163.com
# @software: garner
# @file: demo123.py
# @time: 2020-01-03 20:01
# @desc:
import yaml
import os
import io


# 获取当前文件路径 /Users/lee/Aplum
def Read_file(Filename=""):
    # 获取配置文件的路径  /Users/lee/Aplum/config/Data_based_config.yaml
    yamlPath = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'DBconfig',Filename)
    # 加上 ,encoding='utf-8'，处理配置文件中含中文出现乱码的情况。
    f = io.open(yamlPath, encoding='utf-8')
    x = yaml.load(f, Loader=yaml.FullLoader)
    return x


if __name__ == '__main__':
    Read_file()
    
